/*
 * Filename: c:\Users\93692\Desktop\仓储管理系统\zhcg-zhqh\src\services\modules\GongZuoLiangTongJiTiBao.js
 * Path: c:\Users\93692\Desktop\仓储管理系统\zhcg-zhqh
 * Created Date: Monday, October 12th 2020, 4:47:53 pm
 * Author: chenxin
 *  工作流组件
 * Copyright (c) 2020 Your Company
 */

// 引入axios | 路径配置
import { AJAX_PATH } from "@/services/config.js";

// 导入 封装的 有权限请求
import { HTTP_LIMITED } from "@/utils/axios.js";

class workflowHttp extends HTTP_LIMITED {
  // 根据任务id查询人员信息

  getUserInfoByTaskId(data) {
    return this._get(AJAX_PATH.getUserInfoByTaskId + data);
  }

  // 根据流程名称查询角色名称
  getRoleByProcessName(data) {
    return this._get(AJAX_PATH.getRoleByProcessName + data);
  }
  // 根据角色名称查询人员信息
  getUserRoleNameByUserNameId(queryPath) {
    return this._get(AJAX_PATH.getUserRoleNameByUserNameId + queryPath);
  }
  // 根据任务名称查询流程中包含的步骤
  getProcessstepByFlowName(queryPath) {
    return this._get(AJAX_PATH.getProcessstepByFlowName + queryPath);
  }

  // --------------- 工作流接口 ----------------------

  //拉取待办任务列表
  postUpcomingTasksList(queryPath) {
    return this._post(AJAX_PATH.postUpcomingTasksList + queryPath);
  }

  //查看运行中的流程信息
  postProcessInformation(options) {
    return this._post(AJAX_PATH.postProcessInformation, options);
  }

  //办理任务
  postHandleTasks(options) {
    return this._post(AJAX_PATH.postHandleTasks, options);
  }

  //获取已办任务列表
  postFinishTaskList(queryPath) {
    return this._post(AJAX_PATH.postFinishTaskList + queryPath);
  }

  //作废一项流程
  postDeleteTask(options) {
    return this._post(AJAX_PATH.postDeleteTask, options);
  }

  zuofeishenqing(data) {
    //作废
    return this._post(AJAX_PATH.zuofeishenqing, data);
  }

  //查阅历史信息
  postQueryHisInfo(options) {
    return this._post(AJAX_PATH.postQueryHisInfo, options);
  }

  //彻底删除流程
  postFinalDeleteTask(options) {
    return this._post(AJAX_PATH.postFinalDeleteTask, options);
  }
  //更改工作流中代办的表格信息
  updatechangeForm(queryPath, data) {
    return this._post(AJAX_PATH.updatechangeForm + queryPath, data);
  }
}

export { workflowHttp };
